import json

from tool import get_pre_prompt, get_replace, get_questions, replace_func

'''
生成一次性问1个问题的prompt
'''

if __name__ == "__main__":
    pre_prompt = get_pre_prompt("pre_single_prompt")
    replace = get_replace()
    questions = get_questions()

    questions = [q.split(".")[1].strip() for q in questions]
    replace["问题"] = questions
    pre_prompt += "\n" + "{问题}"

    prompts = replace_func(pre_prompt + "\n" + "\n".join(questions), replace)
    # 写入文件
    with open("tmp/prompts_v2.json", "w", encoding="utf8") as f:
        json.dump(prompts, f, ensure_ascii=False)
